<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>
    <link rel="stylesheet" href="resource/css/bootstrap.css">
    <script src="resource/js/jquery-3.2.1.js"></script>
    <script src="resource/js/bootstrap.js"></script>
    <script type="text/javascript" src="/resource/My97DatePicker/WdatePicker.js"></script>
</head>
<body>
    <form method="post" action="list">
        <input type="button" value="增加" onclick="add()">
        收货单号:<input type="text" name="shouhuoid" value="${s.shouhuoid}">
        <select name="lx1">
            <option value="">--请选择--</option>
            <option value="0">收货时间</option>
            <option value="1">制单时间</option>
        </select>
        <input type="date" name="mintime1" value='<fmt:formatDate value="${s.mintime1}" pattern="yyyy-MM-dd"></fmt:formatDate>'>
        至<input type="date" name="maxtime1" value='<fmt:formatDate value="${s.maxtime1}" pattern="yyyy-MM-dd"></fmt:formatDate>'>
        优先级:<input type="text" name="minyxj" value="${s.minyxj}">至
        <input type="text" name="maxyxj" value="${s.maxyxj}"><br>
        <select name="lx2">
            <option value="">--请选择--</option>
            <option value="0">客户</option>
            <option value="1">客户发单列表</option>
            <option value="2">制单人</option>
            <option value="3">制单人工号</option>
        </select>
        <input type="text" name="neirong" value="${s.neirong}">
        优先级排序:<select name="paixu">
               <option value="">请选择</option>
               <option value="asc">升序</option>
               <option value="desc">降序</option>
          </select>
        备注:<input type="text" name="beizhu" value="${s.beizhu}">
        <input type="button" value="搜索" onclick="sousuo()"><br>
        <table class="table">
            <tr>
                <th>序号</th>
                <th>收货日期</th>
                <th>收货单号</th>
                <th>优先级</th>
                <th>状态</th>
                <th>备注</th>
                <th>客户</th>
                <th>客户发货单列表</th>
                <th>制单人工号</th>
                <th>制单人</th>
                <th>制单时间</th>
                <th>收货附件</th>
                <th>操作</th>
            </tr>
            <c:forEach items="${list}" var="e">
                <tr>
                    <td>${e.id}</td>
                    <td><fmt:formatDate value="${e.stime}" pattern="yyyy-MM-dd"></fmt:formatDate> </td>
                    <td>${e.shouhuoid}</td>
                    <td>${e.youxianji}</td>
                    <td>
                        <c:if test="${e.status==1}">计划中</c:if>
                        <c:if test="${e.status==2}">执行中</c:if>
                        <c:if test="${e.status==3}">已取消</c:if>
                        <c:if test="${e.status==4}">已完成</c:if>
                    </td>
                    <td>${e.beizhu}</td>
                    <td>${e.kehu}</td>
                    <td>${e.kehufadan}</td>
                    <td>${e.gid}</td>
                    <td>${e.uname}</td>
                    <td><fmt:formatDate value="${e.zhidantime}" pattern="yyyy-MM-dd"></fmt:formatDate> </td>
                    <td>${e.picurl}</td>
                    <td>
                        <c:if test="${e.status==3}">
                            已取消
                        </c:if>
                        <c:if test="${e.status!=3}">
                            <a href="#">修改</a>
                            <a href="#"><input type="button" value="取消" onclick="qx(${e.id})"> </a>
                        </c:if>
                    </td>
                </tr>
            </c:forEach>
        </table>
    </form>

<script>
    $("[name=lx1]").val('${s.lx1}')
    $("[name=lx2]").val('${s.lx2}')
    function sousuo(){
        findAll("list?"+$("form").serialize())
    }
    function add(){
        findAll("toadd");
    }
    function qx(ids){
        $.post("deleteByid",{ids:ids},function(msg){
            if(msg>0){
                findAll("toindex")
            }
        })
    }
</script>
</body>


</html>